﻿<?php $this->load->view('layout/header'); ?>
<form name="form1" method="post" action="<?php echo b_url('message/message_action').'/'.$info['guestbookid'];?>" id="form1">
    <div id="container">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_form">
            <tr class="table_form_title">
                <td colspan="4">
                    <span id="lblTitle">添加</span>留言
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>昵称：
                </td>
                <td>
                    <input name="nickname" type="text" id="nickname" value="<?php echo $info['nickname']?>"/>
                    <span id="nickname_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>留言内容：
                </td>
                <td>
                    <textarea name="bookcontent" rows="10" cols="50" id="bookcontent"><?php echo $info['bookcontent']?></textarea>
                    <span id="bookcontent_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    IP：
                </td>
                <td>
                    <?php echo $info['ipaddress']?>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    留言时间：
                </td>
                <td>
                    <?php echo $info['addtime']?>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>回复内容：
                </td>
                <td>
                    <textarea name="replycontent" rows="10" cols="50" id="replycontent"><?php echo $info['replycontent']?></textarea>
                    <span id="replycontent_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    回复时间：
                </td>
                <td>
                    <?php echo $info['replytime']?>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    回复人：
                </td>
                <td>
                    <?php
                    foreach($admin as $k=>$v){
                        if($v['adminid'] == $info['adminid']){
                            echo $v['adminname'];
                            break;
                        }else{
                            continue;
                        }
                    } 
                    ?>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    是否关闭：<?php echo ($info['isclose']);?>
                </td>
                <td>
                    <span id="idclose">
                        <input  type="radio" name="isclose" value="1" <?php if($info['isclose'] == 1){echo 'checked="checked"';}?>/><label for="radIsClose_0">是</label>
                        <input  type="radio" name="isclose" value="0" <?php if($info['isclose'] == 0 || empty($info)){echo 'checked="checked"';}?> /><label for="radIsClose_1">否</label>
                    </span>
                </td>
            </tr>
            <tr class="table_form_btn">
                <td align="right">&nbsp;
                    
                </td>
                <td colspan="3">
                    <input type="submit"  value="保存"  id="btnSave" />
                    <input type="button"  value="返回" onclick="javascript:history.go(-1);" />
                    <span id="errMsg" style="color:Red;"></span>
                </td>
            </tr>
        </table>
    </div>
</form> 
<script type="text/javascript">
$('#form1').submit(function() {
	var is = true;
	if (!input_tips($('#nickname'))) {
	    is = false;
	}
	if (!input_tips($('#bookcontent'))) {
	    is = false;
	}
	if (!input_tips($('#replycontent'))) {
	    is = false;
	}
	return false;
})
</script>
<?php $this->load->view('layout/footer'); ?>
